Optimal. Leaf size=48 \[ -\frac {b \tanh ^{-1}(\cos (c+d x))}{d}-\frac {a \cot (c+d x)}{d}+\frac {b \sec (c+d x)}{d}+\frac {a \tan (c+d x)}{d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.07, antiderivative size = 48, normalized size of antiderivative = 1.00, number of steps
used = 7, number of rules used = 6, integrand size = 27, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.222, Rules used = {2917, 2700, 14,
2702, 327, 213} \begin {gather*} \frac {a \tan (c+d x)}{d}-\frac {a \cot (c+d x)}{d}+\frac {b \sec (c+d x)}{d}-\frac {b \tanh ^{-1}(\cos (c+d x))}{d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 14
Rule 213
Rule 327
Rule 2700
Rule 2702
Rule 2917
Rubi steps
\begin {align*} \int \csc ^2(c+d x) \sec ^2(c+d x) (a+b \sin (c+d x)) \, dx &=a \int \csc ^2(c+d x) \sec ^2(c+d x) \, dx+b \int \csc (c+d x) \sec ^2(c+d x) \, dx\\ &=\frac {a \text {Subst}\left (\int \frac {1+x^2}{x^2} \, dx,x,\tan (c+d x)\right )}{d}+\frac {b \text {Subst}\left (\int \frac {x^2}{-1+x^2} \, dx,x,\sec (c+d x)\right )}{d}\\ &=\frac {b \sec (c+d x)}{d}+\frac {a \text {Subst}\left (\int \left (1+\frac {1}{x^2}\right ) \, dx,x,\tan (c+d x)\right )}{d}+\frac {b \text {Subst}\left (\int \frac {1}{-1+x^2} \, dx,x,\sec (c+d x)\right )}{d}\\ &=-\frac {b \tanh ^{-1}(\cos (c+d x))}{d}-\frac {a \cot (c+d x)}{d}+\frac {b \sec (c+d x)}{d}+\frac {a \tan (c+d x)}{d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.07, size = 68, normalized size = 1.42 \begin {gather*} -\frac {a \cot (c+d x)}{d}-\frac {b \log \left (\cos \left (\frac {1}{2} (c+d x)\right )\right )}{d}+\frac {b \log \left (\sin \left (\frac {1}{2} (c+d x)\right )\right )}{d}+\frac {b \sec (c+d x)}{d}+\frac {a \tan (c+d x)}{d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.14, size = 61, normalized size = 1.27
method | result | size |
derivativedivides | \(\frac {a \left (\frac {1}{\sin \left (d x +c \right ) \cos \left (d x +c \right )}-2 \cot \left (d x +c \right )\right )+b \left (\frac {1}{\cos \left (d x +c \right )}+\ln \left (\csc \left (d x +c \right )-\cot \left (d x +c \right )\right )\right )}{d}\) | \(61\) |
default | \(\frac {a \left (\frac {1}{\sin \left (d x +c \right ) \cos \left (d x +c \right )}-2 \cot \left (d x +c \right )\right )+b \left (\frac {1}{\cos \left (d x +c \right )}+\ln \left (\csc \left (d x +c \right )-\cot \left (d x +c \right )\right )\right )}{d}\) | \(61\) |
risch | \(\frac {2 b \,{\mathrm e}^{3 i \left (d x +c \right )}-4 i a -2 b \,{\mathrm e}^{i \left (d x +c \right )}}{d \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right ) \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )}-\frac {b \ln \left ({\mathrm e}^{i \left (d x +c \right )}+1\right )}{d}+\frac {b \ln \left ({\mathrm e}^{i \left (d x +c \right )}-1\right )}{d}\) | \(96\) |
norman | \(\frac {\frac {a}{2 d}-\frac {5 a \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2 d}-\frac {5 a \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2 d}+\frac {a \left (\tan ^{6}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2 d}-\frac {2 b \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}-\frac {2 b \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{d}}{\tan \left (\frac {d x}{2}+\frac {c}{2}\right ) \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )-1\right ) \left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}+\frac {b \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}\) | \(149\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.27, size = 59, normalized size = 1.23 \begin {gather*} \frac {b {\left (\frac {2}{\cos \left (d x + c\right )} - \log \left (\cos \left (d x + c\right ) + 1\right ) + \log \left (\cos \left (d x + c\right ) - 1\right )\right )} - 2 \, a {\left (\frac {1}{\tan \left (d x + c\right )} - \tan \left (d x + c\right )\right )}}{2 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.41, size = 96, normalized size = 2.00 \begin {gather*} -\frac {b \cos \left (d x + c\right ) \log \left (\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) \sin \left (d x + c\right ) - b \cos \left (d x + c\right ) \log \left (-\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) \sin \left (d x + c\right ) + 4 \, a \cos \left (d x + c\right )^{2} - 2 \, b \sin \left (d x + c\right ) - 2 \, a}{2 \, d \cos \left (d x + c\right ) \sin \left (d x + c\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \left (a + b \sin {\left (c + d x \right )}\right ) \csc ^{2}{\left (c + d x \right )} \sec ^{2}{\left (c + d x \right )}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 103 vs.
\(2 (48) = 96\).
time = 0.48, size = 103, normalized size = 2.15 \begin {gather*} \frac {6 \, b \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) \right |}\right ) + 3 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - \frac {2 \, b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 15 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 10 \, b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 3 \, a}{\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}}{6 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 11.91, size = 92, normalized size = 1.92 \begin {gather*} \frac {5\,a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+4\,b\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )-a}{d\,\left (2\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )-2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3\right )}+\frac {a\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{2\,d}+\frac {b\,\ln \left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}{d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________